{#自定义：修改表容器#}
{%- block form_widget_compound -%}
        {%- if form.parent is empty -%}
            {{ form_errors(form) }}
        {%- endif -%}
        {{- block('form_rows') -}}
        {{- form_rest(form) -}}
{%- endblock form_widget_compound -%}

{#自定义：单行结果显示#}
{% block form_row %}
    {% spaceless %}
        {#{{ dump(form.vars) }}#}
        <div id="row_{{ form.vars.name }}" class="layui-form-item {{ form.vars.attr.datatype == "hidden" ? "hidden" : '' }}" >
            <label class="layui-form-label">{{ form_label(form) }}</label>
            <div class="layui-input-block">
                {{ form_widget(form) }}
            </div>
            <div class="layui-form-mid layui-word-aux">{{ form_errors(form) }}</div>
        </div>
    {% endspaceless %}
{% endblock form_row %}

{#{%- block textarea_widget -%}#}
  {#<textarea  {{ block('widget_attributes') }}>{{ value }}</textarea>#}
{#{%- endblock textarea_widget -%}#}

{#自定义：普通文本#}
{% block text_widget %}
    {% set type = type|default('text') %}
    {#<input type="text" name="title" placeholder="请输入标题" autocomplete="off" class="layui-input">#}
    <input type="{{ type }}"  lay-verify="{{ attr.datatype }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
{% endblock text_widget %}

{#自定义：普通文本#}
{#{%- block form_widget_simple -%}#}
    {#{%- set type = type|default('text') -%}#}
    {#<input type="{{ type }}"  class="input normal" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>#}
    {#<input type="{{ type }}"  lay-verify="{{ attr.datatype }}"  class="layui-input" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>#}
{#{%- endblock form_widget_simple -%}#}

{#自定义：图片 改写自URL#}
{%- block search_widget -%}
    {%- set type = 'text' -%}
    <div class="flex-r flex-center">
        <input type="{{ type }}"  lay-verify="{{ attr.datatype }}"  class="layui-input upload-path" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
        <span class="layui-btn layui-btn-primary upload-box upload-img"></span>
    </div>
{%- endblock search_widget -%}

{#自定义：图片 新增类型#}
{%- block pic_widget -%}
    {%- set type = 'text' -%}
    <input type="{{ type }}"  lay-verify="{{ attr.datatype }}"  class="layui-input" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
    {#<button class="layui-btn layui-btn-normal"><div class="upload-box upload-img"></div></button>#}
{%- endblock pic_widget -%}

{#自定义：下拉列表#}
{%- block choice_widget_collapsed -%}

    {% spaceless %}
    {%- if required and placeholder is none and not placeholder_in_choices and not multiple -%}
        {% set required = false %}
    {%- endif -%}
    <select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}  lay-verify="">
        {%- if placeholder is not none -%}
            <option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder != '' ? (translation_domain is same as(false) ? placeholder : placeholder|trans({}, translation_domain)) }}</option>
        {%- endif -%}
        {%- if preferred_choices|length > 0 -%}
            {% set options = preferred_choices %}
            {{- block('choice_widget_options') -}}
            {%- if choices|length > 0 and separator is not none -%}
                <option disabled="disabled">{{ separator }}</option>
            {%- endif -%}
        {%- endif -%}
        {%- set options = choices -%}
        {{- block('choice_widget_options') -}}
    </select>
    {% endspaceless %}
{%- endblock choice_widget_collapsed -%}

{#自定义：单选复选框#}
{%- block choice_widget_expanded -%}
    <div {{ block('widget_container_attributes') }}>
        {%- for child in form %}
            {{- form_widget(child) -}}
        {% endfor -%}
    </div>
{%- endblock choice_widget_expanded -%}

{#自定义：多选#}
{%- block checkbox_widget -%}
    {#<label>{{ label }}<input type="checkbox" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} /></label>#}
    <input title="{{ label }}" type="checkbox" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
{%- endblock checkbox_widget -%}

{#自定义：单选#}
{%- block radio_widget -%}
    {#<label>{{ label }}<input type="radio" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} /></label>#}
    <input title="{{ label }}" type="radio" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
{%- endblock radio_widget -%}

{#自定义：报错#}
{%- block form_errors -%}
    {%- if errors|length > 0 -%}
        <ul>
            {%- for error in errors -%}
                <span class="Validform_checktip Validform_wrong">{{ error.message }}</span>
            {%- endfor -%}
        </ul>
    {%- endif -%}
{%- endblock form_errors -%}